{include file='header.html'}
<link type="text/css" href="../../page/css/delay.css" rel="stylesheet">
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery.ui.theme.css" rel="stylesheet" />
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery.ui.datepicker.css" rel="stylesheet" />
<link type="text/css" href="{$common_domain}/tools/datepicker/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery-1.7.2.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.core.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.widget.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/jquery.ui.datepicker.js"></script>
<script type="text/javascript" src="{$common_domain}/tools/datepicker/DateTimePicker.js"></script>
<script type="text/javascript">

$(function () {
    $("#datetimepicker").datepicker({ showtime: false});
    $("#reason").change(function(){
        if($(this).val()=='地铁故障'){
            $("#upfile").show();
        }else{
            $("#upfile").hide();
        }
    });

    $("form:first").submit(function(){
        if(confirm("确定提交吗?")){
            if($("input[name ='now_date']").val()== '' || $("input[name ='delay_type']").val()== '' ){
                alert('日期和考勤类型必填');
                return false;
            } else if($("select[name ='reason']").val()== '其它' && $("textarea[name ='desc']").val()== '') {
                alert('原因为其它时，必须填写Note!');
                return false;
            } else if($("select[name ='reason']").val() == "请选择"){
                alert('请选择原因!');
                return false;
            }else{
                return true;
            }
        }
        else{
            return false;
        }
    }
    );
});

function new_page(url) {
    //window.location.replace(url);
    window.location = url;
}
</script>
<div id="content">
    <i class="con_l">&nbsp;</i> <i class="con_r">&nbsp;</i>
    <div class="main">
        <div class="blank"></div>

        <form action="" method="post" enctype="multipart/form-data">
            <ul class="ul_cc">
            <li class="s">
                <b class="li_b">日期</b>
                <!-- <input id = "datetimepicker" class="jko" name="now_date" readonly = "readonly" type="text" value="{$from_date}"/> -->
                <input name="now_date" readonly = "readonly" type="text" value="{$from_date}"  class="jko"/>
                <input type="hidden"   name="start_time" value="{$start_time}">
                <input type="hidden"   name="end_time" value="{$end_time}" >
            <li>

            <li class="s">
                <b class="li_b">考勤类型</b>
                {if $typename == '全天缺勤' || $typename == '上午缺勤' || $typename == '下午缺勤'}
                    <input name="" readonly = "readonly" type="text" value="{$typename}" style="border:none" />
                {else}
                    <input name="" readonly = "readonly" type="text" value="{$delay_type}" style="border:none" />
                {/if}
                    <input name="delay_type"  type="hidden" value="{$delay_type}" />
            <li>

            <li class="s">
                <b class="li_b">原因</b>
                <input type="radio" checked="checked"/>
                <select name = "reason" id="reason">
                    <option value="请选择">请选择</option>
                   {if $delay_type=='迟到' || $typename=='上午缺勤'} <option value="地铁故障">地铁故障</option>{/if}
                   {if $delay_type!='早退'}<option value="忘记带卡">忘记带卡</option>{/if}
                   <option value="忘记刷卡">忘记刷卡</option>
                    <option value="其它">其它</option>
                </select>
                <a href="/askleave/?fd={$from_date}&s={$start_time}&e={$end_time}" class="r_link"><input type="radio" onclick="new_page('/askleave/?fd={$from_date}&s={$start_time}&e={$end_time}')"/>请假</a>
                <a href="/corptrip/?fd={$from_date}&s={$start_time}&e={$end_time}" class="r_link"><input type="radio" onclick="new_page('/corptrip/?fd={$from_date}&s={$start_time}&e={$end_time}')"/>公出</a>
                <a href="/trip/" class="r_link"><input type="radio" onclick="new_page('/trip/')"/>出差</a>
            <li>

            <li class="s" id="upfile" {if $delay_type=='早退' or $typename=='全天缺勤'} style="display:none;" {/if} >
                <b class="li_b">图片(文件大小<2M)</b>
                <a id="" href="javascript:;" class="tian_one_span">
                  上传证明
                  <input id="photo_up" class="vis2op" type="file" hidefocus="hidefocus" name="file">
                </a>
            <li>

            <li class="s">
                <b class="li_b">审批人：{$audit_user}</b>
            <li>

            <li class="s">
                <b class="li_b">Note:</b>
                <textarea name = "desc" rows="5" cols="30" id="tre"></textarea>
            <li>

            <li class="s"><input type="submit" class="lgo" value="提交申请"></li>
            </ul>

        </form>

    </div>
</div>
{include file='footer.html'}
